package ingress

import (
	"kms-backend/controllers/ingress"

	"github.com/gin-gonic/gin"
)

// 新增
func create(ingressGroup *gin.RouterGroup) {
	ingressGroup.POST("/create", ingress.Create)
}

// 更新
func update(ingressGroup *gin.RouterGroup) {
	ingressGroup.POST("/update", ingress.Update)
}

func detail(ingressGroup *gin.RouterGroup) {
	ingressGroup.GET("/detail", ingress.Detail)
}

func list(ingressGroup *gin.RouterGroup) {
	ingressGroup.GET("/list", ingress.List)
}

func delete(ingressGroup *gin.RouterGroup) {
	ingressGroup.POST("/delete", ingress.Delete)
}

func RegisterSubRouter(g *gin.RouterGroup) {
	// 配置路由策略
	ingressGroup := g.Group("/ingress")
	create(ingressGroup)
	update(ingressGroup)
	detail(ingressGroup)
	list(ingressGroup)
	delete(ingressGroup)

}
